#ifndef J3DGRAPH_BMD_TEX1_HEADER
#define J3DGRAPH_BMD_TEX1_HEADER

// this header needs
#include <stdio.h>
#include "../../J3DGRAPH.h"

// TEX1 section constants
umax J3DGRAPH_BMD_TEX1_POS = 7;
// ^ subject to change depending if file is BMD/BDL

// j3dgraph_bmd_tex1_err_cd enum
// enum with the possible codes a TEX1 section will present while analizing it
// errors codes are organized so fatal errors have less magnitude than the soft errors
typedef enum
{
  J3DGRAPH_BMD_TEX1_ERR_INV_STRUCT, // j3dgraph struct ptr is NULL/empty
  J3DGRAPH_BMD_TEX1_ERR_HEADER,     // section header is inconsistent
  
  J3DGRAPH_BMD_TEX1_ERR_NO_ERR,     // errors below this (in value) are fatal, above or equal are safe
  
  // ...
} j3dgraph_bmd_tex1_err_cd;

// BMD TEX1 section (complete)
typedef struct
{
  // my additions
  char * PATH;                      // file path
  ENDIAN_T ENDIAN;                  // endian
  j3dgraph_bmd_tex1_err_cd ERR_CD;  // error code
  // actual structure
  byte * START;                     // 00 char[4]
  byte * SIZE;                      // 01 uint32
  byte * TEX_CNT;                   // 01 uint16
  byte * UNK_1;                     // 02 2 bytes
  byte * BTI_HEADER_LIST_OFFSET;    // 03 uint32
  byte * TEX_STR_TB_OFFSET;         // 04 uint32
  byte * PAD_1;                     // 05 ?? (padding to 32 multiple address)
  byte * BTI_HEADER_LIST;           // 06 TEX_COUNT * 32 bytes
  byte * BTI_DATA_LIST;             // 07 ??
  j3dgraph_str_tb * TEX_STR_TB;     // 08 ??
  byte * PAD_2;                     // 09 ?? (padding to 32 multiple address)
} j3dgraph_bmd_tex1;

// functions to check the information on the BMD TEX1 section
j3dgraph_bmd_tex1_err_cd check_j3dgraph_bmd_tex1(j3dgraph * file);

// append/remove/print the j3dgraph_bmd_tex1
// structure to an incomplete j3dgraph structure
j3dgraph_bmd_tex1 * append_j3dgraph_bmd_tex1(j3dgraph * file);
void remove_j3dgraph_bmd_tex1(j3dgraph * file);
void print_j3dgraph_bmd_tex1(j3dgraph_bmd_tex1 * tex1);

#include "TEX1.c"

#endif // J3DGRAPH_BMD_TEX1_HEADER
